/**
 * @author zhangshuai
 * @version V1.0
 * @Project Java2_26
 * @Package PACKAGE_NAME
 * @Description:
 * @Date 2025/5/13 8:58
 */

public class Demo2 {
    //面向对象：大象装进冰箱
    //大象：会钻进去冰箱
    //冰箱：自己开门，自己关门
    public static void main(String[] args) {
        //创建大象对象
        Elephant elephant = new Elephant();
        //创建冰箱对象
        Refrigerator refrigerator = new Refrigerator();
        //打开冰箱门
        refrigerator.open();
        //把大象装进冰箱
        elephant.putIn();
        //关闭冰箱门
        refrigerator.close();

    }

    //大象类
   static class Elephant{

        public void putIn(){
            System.out.println("大象钻进去了");
        }
    }
    //冰箱类
   static class Refrigerator{
        public void open(){
            System.out.println("冰箱门打开了");
        }
        public void close(){
            System.out.println("冰箱门关闭了");
        }
    }
}